Export symbols needed by Android drivers
authorBen Hutchings <ben@decadent.org.uk>
Mon, 7 Sep 2020 01:51:53 +0000 (02:51 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Mon, 12 Aug 2024 18:18:17 +0000 (20:18 +0200)
Bug-Debian: https://bugs.debian.org/901492

We want to enable use of the Android ashmem and binder drivers to
support Anbox, but they should not be built-in as that would waste
resources and increase security attack surface on systems that don't
need them.

Export the currently un-exported symbols they depend on.

Gbp-Pq: Topic debian
Gbp-Pq: Name export-symbols-needed-by-android-drivers.patch

fs/file.c
kernel/sched/core.c
kernel/sched/wait.c
kernel/task_work.c
mm/memory.c
mm/shmem.c
security/security.c

index a11e59b5d6026a2e2b195815582f3b48e5b4e331..aa75e8a5da5c0cb0a9c0dbbbfc772b7cd77cc77d 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -823,6 +823,7 @@ struct file *file_close_fd(unsigned int fd)
 
        return file;
 }
+EXPORT_SYMBOL_GPL(file_close_fd);
 
 void do_close_on_exec(struct files_struct *files)
 {
index ebf21373f6634ff2c9f88649f760636a3ee8a19f..821d783e8a4bb72ea84d3955f972cac187dc0091 100644 (file)
@@ -7338,6 +7338,7 @@ static bool is_nice_reduction(const struct task_struct *p, const int nice)
 
        return (nice_rlim <= task_rlimit(p, RLIMIT_NICE));
 }
+EXPORT_SYMBOL_GPL(can_nice);
 
 /*
  * can_nice - check if a task can reduce its nice value
index 51e38f5f47018c953e31c834dc6385c182359359..8b3547706b00a8e07363253f61f6d08e83ff966e 100644 (file)
@@ -212,6 +212,7 @@ void __wake_up_pollfree(struct wait_queue_head *wq_head)
        /* POLLFREE must have cleared the queue. */
        WARN_ON_ONCE(waitqueue_active(wq_head));
 }
+EXPORT_SYMBOL_GPL(__wake_up_pollfree);
 
 /*
  * Note: we use "set_current_state()" _after_ the wait-queue add,
index 2134ac8057a94e64b42d75607f9753e6e82526aa..77587455234314085e4b3dfa8bca53fc3c8fd337 100644 (file)
@@ -73,6 +73,7 @@ int task_work_add(struct task_struct *task, struct callback_head *work,
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(task_work_add);
 
 /**
  * task_work_cancel_match - cancel a pending work added by task_work_add()
index 755ffe082e2178c97cc05af8baf322f5e6c5372e..b56018b25e5cce67e72f860d641428f92be67fbd 100644 (file)
@@ -1922,6 +1922,7 @@ void zap_page_range_single(struct vm_area_struct *vma, unsigned long address,
        tlb_finish_mmu(&tlb);
        hugetlb_zap_end(vma, details);
 }
+EXPORT_SYMBOL_GPL(zap_page_range_single);
 
 /**
  * zap_vma_ptes - remove ptes mapping the vma
index c1befe046c7eb2a3de6d8398bee6d5638dfe5376..a2e2194468bf5d81db32587c2bd1c5b2cee5cabb 100644 (file)
@@ -4942,6 +4942,7 @@ int shmem_zero_setup(struct vm_area_struct *vma)
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(shmem_zero_setup);
 
 /**
  * shmem_read_folio_gfp - read into page cache, using specified page allocation flags.
index 8cee5b6c6e6d53ceb213feab8b0bd53bcc886c7b..1ae10c4b93f93e0e22b57765f893a668ad4d3d5d 100644 (file)
@@ -890,6 +890,7 @@ int security_binder_set_context_mgr(const struct cred *mgr)
 {
        return call_int_hook(binder_set_context_mgr, mgr);
 }
+EXPORT_SYMBOL_GPL(security_binder_set_context_mgr);
 
 /**
  * security_binder_transaction() - Check if a binder transaction is allowed
@@ -905,6 +906,7 @@ int security_binder_transaction(const struct cred *from,
 {
        return call_int_hook(binder_transaction, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transaction);
 
 /**
  * security_binder_transfer_binder() - Check if a binder transfer is allowed
@@ -920,6 +922,7 @@ int security_binder_transfer_binder(const struct cred *from,
 {
        return call_int_hook(binder_transfer_binder, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transfer_binder);
 
 /**
  * security_binder_transfer_file() - Check if a binder file xfer is allowed
@@ -936,6 +939,7 @@ int security_binder_transfer_file(const struct cred *from,
 {
        return call_int_hook(binder_transfer_file, from, to, file);
 }
+EXPORT_SYMBOL_GPL(security_binder_transfer_file);
 
 /**
  * security_ptrace_access_check() - Check if tracing is allowed